<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="ISO-8859-1"%>
    <%@taglib uri="/struts-tags" prefix="s"%>
    <%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link href="/passeport-animalier/css/main.css" rel="stylesheet" type="text/css"/>
<title><s:text name="espace.administrareur"/> </title>
	<sj:head  jqueryui="true" jquerytheme="smoothness"/>
	<script type="text/javascript">
	 
	  function loginChange(){
		  var nom=document.getElementById("nom");
		  var prenom=document.getElementById("prenom");
		  var login=document.getElementById("login");
		  login.value=nom.value+'.'+prenom.value;
	  };
	</script>
</head>
<body>
	<jsp:include page="../layout/navigation_bar.jsp"/>
	<jsp:include page="../layout/header.jsp"/>
	<div class="wrapper">
		<jsp:include page="../layout/menu.jsp"/>
		<div class="content">
			<div class="title">
				<h5> <s:text name="menu.rh.nouveau_fermier"/> </h5>
			</div>
			<s:if test="hasActionErrors()">
 			<div class="nNote nFailure">
				<p>
					<s:actionerror/>
				</p>
			</div> 
 			</s:if>
 			<s:if test="hasActionMessages()">  
			    <div class="nNote nSuccess" style="padding-left:47px;">  
			   		<p>
			       	 <s:actionmessage/> 
			        </p>
			    </div>  
			</s:if> 
			<div class="widget first" style="width: 60%;" >
				<div class="head">
				     <h5 class="iList"> <s:text name="form.creation"/> </h5>
			    </div>
			    <div class="body">
			    	<s:form action="v_nouveau_fermier" namespace="/admin" cssClass="mainForm" method="post" theme="simple">
			    			<div class="rowElem">
								<label> <s:text name="presonne.nom"/> </label>
								<div class="formRight">
								<input type="text" value="${fermier.nom}" name="fermier.nom" id="nom" onkeypress="loginChange();">
								<span class="field_error"> <s:property value="errors['fermier.nom']"/> </span>
								</div>
								<div class="fix"></div>
							</div>
			    			<div class="rowElem">
								<label> <s:text name="presonne.prenom"/> </label>
								<div class="formRight">
								<input type="text" value="${fermier.prenom}" name="fermier.prenom" id="prenom" onkeypress="loginChange();">
								<span class="field_error"> <s:property value="errors['fermier.prenom']"/> </span>
								</div>
								<div class="fix"></div>
							</div>
							<div class="rowElem">
								<label> <s:text name="personne.userName"/> </label>
								<div class="formRight">
								<input type="text" value="${fermier.compte.login}" name="fermier.compte.login" id="login">
								 <span class="field_error"> <s:property value="errors['fermier.compte.login']"/> </span>
								</div>
								<div class="fix"></div>
							</div>
							<div class="rowElem">
								<label> <s:text name="presonne.dateNaissance"/> </label>
								<div class="formRight">
								<%-- <input type="text" value="${fermier.dateNaissance}" name="fermier.dateNaissance"> --%>
								<sj:datepicker id="date0" label="Select a Date" displayFormat="dd/mm/yy" name="fermier.dateNaissance" cssStyle="width:80%;margin-right:4px;" buttonImage="/passeport-animalier/images/icons/color/calendar-day-10.png" />
								<span class="field_error"> <s:property value="errors['fermier.dateNaissance']"/> </span>
								</div>
								<div class="fix"></div>
							</div>
							<div class="rowElem">
								<label> <s:text name="presonne.telephone"/> </label>
								<div class="formRight">
								<input type="text" value="${fermier.telephone}" name="fermier.telephone">
								<span class="field_error"> <s:property value="errors['fermier.telephone']"/> </span>
								</div>
								<div class="fix"></div>
							</div>
							<div class="rowElem">
								<label> <s:text name="presonne.email"/> </label>
								<div class="formRight">
								<input type="text" value="${fermier.compte.email}" name="fermier.compte.email">
								<span class="field_error"> <s:property value="errors['fermier.compte.email']"/> </span>
								</div>
								<div class="fix"></div>
							</div>
							<div class="rowElem">
								<label> <s:text name="fermier.salaire"/> </label>
								<div class="formRight">
								<input type="text" value="${fermier.salaire}" name="fermier.salaire">
								<span class="field_error"> <s:property value="errors['fermier.salaire']"/> </span>
								</div>
								<div class="fix"></div>
							</div>
							<div class="rowElem">
								<label><s:text name="betail.type"/> </label>
								<div class="formRight">
									<div class="selector" id="uniform-undefined">
										<span style="-moz-user-select: none;" id="span"> <s:property value=""/> </span>
										<s:select list="typesBetail" name="typeBetail" cssStyle="opacity:0;" id="select" onclick="change();"/>
										<script type="text/javascript">
										   var selectElmt = document.getElementById("select");
										   var span = document.getElementById("span");
										   span.innerHTML=selectElmt.options[0].text;
											function change(){
												var textselectionne = selectElmt.options[selectElmt.selectedIndex].text;
												span.innerHTML=textselectionne;
												
											}
										</script>
									</div>
								</div>
							</div>
							<div class="rowElem">
								<s:submit cssClass="greyishBtn submitForm" value="%{getText('form.save')}"/>
							</div>
							<div class="fix"></div>
			    	</s:form>
			    </div>
		    </div>
	    </div>
	</div>
	<jsp:include page="../layout/footer.jsp"/>
</body>
</html>